package csc.daonjpa.java.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;

@Entity
@Table(name="card")
@PrimaryKeyJoinColumn(name="cardNumber")
public class Card  extends BaseInfo implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Column(name="cardType")
	private String cardType;
	@Column(name = "loginId")
	private String loginId;
	@ManyToOne(optional = false)
	@JoinColumn(name="loginId",referencedColumnName="loginId", insertable=false, updatable=false)
	private Customer customer;
	
	public Card(){
		
	}

	
	public String getLoginId() {
		return loginId;
	}


	public void setLoginId(String loginId) {
		this.loginId = loginId;
	}


	public Card(String number, double availableAmount, String cardType, String loginId) {
		super(number, availableAmount);
		this.cardType = cardType;
		this.loginId=loginId;
	}


	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public Customer getCustomer() {
		return customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}
	
	
}
